home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
14228
/
14228.xpi
/
chrome
/
content
/
properties.js
< prev
next >
Wrap
Text File
|
2010-01-29
|
2KB
|
52 lines
var properties_darktrojan_net = {
contextMenu: null,
windowLoad: function () {
window.removeEventListener ('load', properties_darktrojan_net.windowLoad, false);
window.addEventListener ('unload', properties_darktrojan_net.windowUnload, false);
properties_darktrojan_net.contextMenu = document.getElementById ('contentAreaContextMenu');
properties_darktrojan_net.contextMenu.addEventListener ('popupshowing', properties_darktrojan_net.popupShowing, false);
},
windowUnload: function () {
if (properties_darktrojan_net.contextMenu) {
properties_darktrojan_net.contextMenu.addEventListener ('popupshowing', properties_darktrojan_net.popupShowing, false);
}
},
popupShowing: function () {
var onMetaDataItem = gContextMenu.onImage || gContextMenu.onLink;
if (!onMetaDataItem) {
var elem = gContextMenu.target;
while (elem) {
// We display metadata on anything which fits
// the below test, as well as for links and images
// (which set this.onMetaDataItem to true elsewhere)
if ((elem instanceof HTMLQuoteElement && elem.cite) ||
(elem instanceof HTMLTableElement && elem.summary) ||
(elem instanceof HTMLModElement &&
(elem.cite || elem.dateTime)) ||
(elem instanceof HTMLElement &&
(elem.title || elem.lang))) {
onMetaDataItem = true;
break;
}
elem = elem.parentNode;
}
}
gContextMenu.showItem ("context-metadata-separator", onMetaDataItem);
gContextMenu.showItem ("context-metadata", onMetaDataItem);
},
showMetadata: function () {
window.openDialog("chrome://properties_darktrojan_net/content/metaData.xul",
"_blank",
"scrollbars,resizable,chrome,dialog=no",
gContextMenu.target);
}
}
window.addEventListener ('load', properties_darktrojan_net.windowLoad, false);